import { defineConfig } from 'vite'

import AutoImport from 'unplugin-auto-import/vite'  // 自动导入
import Components from 'unplugin-vue-components/vite' // 组件自动导入
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'

import vue from '@vitejs/plugin-vue'

export default defineConfig({
  plugins: [
    vue(),
    AutoImport({
      resolvers: [
        // 自动导入element-plus相关函数
        ElementPlusResolver()
      ],
    }),
    Components({
      resolvers: [
        // 自动导入element-plus相关组件
        ElementPlusResolver(),
      ],
    }),
  ],
  resolve: {
    alias: {
      // '@': fileURLToPath(new URL('./src', import.meta.url))
      '@': '/src'
    }
  }
})
